<template>
	
	<view>
		<view v-for="(item, index) in couponlist">
			<orange-goods-card-home
				
				:tkmoney="item.tkmoney"
				:tkmoneys="item.tkmoney"
				:itemid="item.itemid"
				:shopname='item.shopname'
				:logo="item.shoptype == 'B' ? logo : taobao"
				:itempic="item.itempic + '_310x310.jpg'"
				:itemtitle="item.itemtitle"
				:itemprice="'¥' + item.itemprice"
				:itemsale="item.itemsale"
				:itemendprice="'' + item.itemendprice"
				:couponmoney="item.couponmoney"
			></orange-goods-card-home>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				couponlist:[],
				itemid:"",
				logo: '../../static/img/mao.png',
				taobao: '../../static/img/taobao.png',
			}
		},
		onLoad: function(e) {
			console.log('e',e)
			this.itemid=e.itemid;
					this.$Request.get('/api/get_similar_info/apikey/maxd/itemid/' + this.itemid).then(res => {
						if (res.code === 1) {
							res.data.forEach(d => {
								d.tkmoneys = (d.tkmoney * parseFloat(this.$queue.maxMoney())).toFixed(2);
					
								let grade = this.$queue.getData('grade');
								if (grade) {
									d.tkmoney = (d.tkmoney * parseFloat(grade)).toFixed(2);
								} else {
									d.tkmoney = (d.tkmoney * parseFloat(this.$queue.minMoney)).toFixed(2);
								}
								d.itemsale = d.itemsale > 10000 ? '已售 ' + (d.itemsale / 10000).toFixed(1) + '万' : '已售 ' + d.itemsale;
								this.couponlist.push(d);
							});
						}
					})
				}
			}
		
		
	
</script>

<style>
</style>
